package com.ihr360.cnb.module.insurance.service.feign;

import com.ihr360.cnb.module.insurance.service.feign.fallback.InsuranceStaffBenefitServiceFallback;
import com.ihr360.commons.vo.PageData;
import com.ihr360.insurance.entity.request.StaffBenefitRequest;
import com.ihr360.insurance.entity.request.StaffBenefitVoRequest;
import com.ihr360.insurance.entity.vo.StaffBenefitVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Stone.Shi
 * @description 社保个公积金档案 feign service
 * @date 2018-05-23 09:03:19.
 */
@FeignClient(name = "ihr360-insurance-provider", fallback = InsuranceStaffBenefitServiceFallback.class)
public interface InsuranceStaffBenefitService {

    /**
     * 按条件获取社保公积金的员工数据
     *
     * @param companyId
     * @param staffBenefitRequest search条件
     * @return
     */
    @PostMapping(value = "/staffBenefits/list/", produces = MediaType.APPLICATION_JSON_VALUE)
    PageData<StaffBenefitVo> getBenefitStaffs(@RequestParam(value = "companyId") String companyId,
                                              @RequestBody StaffBenefitRequest staffBenefitRequest);


    /**
     * 社保公积金方案、员工社保公积金档案中保存数据
     *  @param companyId
     * @param request
     */
    @PostMapping(value = "/staffBenefits/staff/save/", produces = MediaType.APPLICATION_JSON_VALUE)
    void saveBenefits(@RequestParam(value = "companyId") String companyId,
                      @RequestBody StaffBenefitVoRequest request);

}
